<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="js/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        $(function () {

            $('.son').click(function (event) {
                alert(1);

                //通过event上的方法阻止事件冒泡
                event.stopPropagation();

                //阻止默认行为 阻止事件冒泡
                return false;


            });
            $('.father').click(function () {
                alert(11);

                return false;
            });
            $('.grandfather').click(function () {
                alert(111);
                return false;
            });


        });
    </script>
    <style type="text/css">
        .grandfather {
            width: 300px;
            height: 300px;
            background-color: green;
            position: relative;
        }

        .father {
            width: 200px;
            height: 200px;
            background-color: gold;
        }

        .son {
            width: 100px;
            height: 100px;
            background-color: pink;
            position: absolute;
            left: 0;
            top: 400px;
        }
    </style>
    <title>Document</title>
</head>

<body>
    <div class="grandfather">
        <div class="father">
            <div class="son">

            </div>
        </div>
    </div>

</body>

</html>